<template>
  <footer class="footer">
    <div class="footer-content">
      <!-- 左侧：Logo + 二维码 + 联系方式 -->
      <div class="footer-left">
        <div class="footer-brand">
          <img src="@/assets/images/logo.png" alt="Logo" class="footer-logo" />

          <div class="qr-wrapper" @click="showQR = true">
            <img src="@/assets/images/QRcode.jpg" alt="二维码" class="footer-qrcode" />
            <p class="qr-hint">点击查看大图</p>
          </div>
        </div>

        <div class="footer-contact">
          <p>地址：陕西省西安市咸宁西路28号</p>
          <p>邮编：710049</p>
          <p>电话：029-82664770</p>
          <p>邮箱：zhiwang@xjtu.edu.cn</p>
        </div>
      </div>

      <!-- 右侧导航区 -->
      <div class="footer-nav">
        <ul>
          <li>
            <h4>关于我们</h4>
            <a href="/about/overview">实验室概况</a>
            <a href="/about/director">主任致辞</a>
            <a href="/about/history">发展历程</a> -->
            <a href="/about/structure">组织架构</a>
            <a href="/about/council">常务理事会</a>
            <a href="/about/team">主任团队</a> -->
          </li>
          <li>
            <h4>新闻中心</h4>
            <a href="/news/partyBuilding">党建学习</a>
            <a href="/news/fastNews">要闻速递</a>
            <a href="/news/research">科研成果</a>
            <a href="/news/notice">通知公告</a>
          </li>
          <li>
            <h4>创新保障</h4>
            <a href="/kxyj/syshxkytd1.htm">机构部门</a>
            <a href="/kxyj/gxjsyfpt.htm">科研团队</a>
            <a href="/kxyj/xyyysfzx1.htm">支撑保障</a>
          </li>
          <li>
            <h4>研究方向</h4>
            <a href="/ydkyjg/bjdxzqdsjyjy.htm">旅游服务信息汇聚</a>
          </li>
          <li>
            <h4>协同合作</h4>
            <a href="/xthz/jgdw.htm">合作单位</a>
            <a href="/xthz/hzxm.htm">合作项目</a>
          </li>
          <li>
            <h4>人才招聘</h4>
            <a href="/rczp/job.htm">招聘岗位</a>
            <a href="/rczp/apply.htm">在线申请</a>
          </li>
          <li>
            <h4>联系我们</h4>
            <a href="/contact/info">联系方式</a>
            <a href="/contact/feedback">反馈留言</a>
          </li>
        </ul>
      </div>
    </div>

    <!-- 底部版权 -->
    <div class="footer-bottom">
      <p>© 2025 大数据分析与应用技术国家工程实验室 版权所有</p>
    </div>

    <!-- 二维码放大弹窗 -->
    <transition name="fade">
      <div v-if="showQR" class="qr-overlay" @click="showQR = false">
        <div class="qr-popup" @click.stop>
          <img src="@/assets/images/QRcode.jpg" alt="放大二维码" />
          <span class="close-btn" @click="showQR = false">×</span>
        </div>
      </div>
    </transition>
  </footer>
</template>

<script setup>
import { ref } from 'vue'
const showQR = ref(false)
</script>

<style scoped>
.footer {
  width: 100%;
  background-color: #910a0a;
  color: #fff;
  padding: 30px 40px 15px;
  box-sizing: border-box;
}

/* 主体布局 */
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
}

/* 左侧部分 */
.footer-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.footer-logo {
  height: 65px;
  object-fit: contain;
}

/* 二维码部分 */
.qr-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.footer-qrcode {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  border: 1px solid #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.qr-wrapper:hover .footer-qrcode {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

/* 提示文字 */
.qr-hint {
  font-size: 12px;
  color: #ffe5e5;
  margin-top: 4px;
  opacity: 0.85;
  transition: opacity 0.3s;
}
.qr-wrapper:hover .qr-hint {
  opacity: 1;
}

/* 联系信息 */
.footer-contact p {
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.4;
}

/* 导航 */
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 35px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 120px;
}

/* 一级标题 */
.footer-nav h4 {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

/* 悬浮时微亮 */
.footer-nav h4:hover {
  color: #ffdddd;
}

/* 二级子链接 */
.footer-nav a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7); /* 半透明弱化 */
  text-decoration: none;
  transition: all 0.3s ease;
}

/* 悬浮时高亮 */
.footer-nav a:hover {
  color: #ffffff;
  transform: translateX(3px); /* 轻微位移增强交互感 */
}

/* 底部版权 */
.footer-bottom {
  text-align: center;
  margin-top: 20px; 
  padding-top: 2px;
  font-size: 13px;
  color: #ddd;
  background-color: #7a0606;
}

/* 弹窗 */
.qr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.qr-popup {
  position: relative;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  animation: scaleIn 0.3s ease;
}
.qr-popup img {
  width: 280px;
  height: 280px;
}
.close-btn {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 28px;
  color: #900;
  cursor: pointer;
}
@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0.3;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.25s;
}
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* 响应式 */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    align-items: center;
  }
  .footer-nav ul {
    flex-direction: column;
    align-items: center;
  }
}
</style>
